<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

use App\Http\Controllers\web\ProductController;


/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/



Route::get('personal',[\App\Http\Controllers\web\PersonalController::class,'index']);

//签到模块
Route::prefix('/')->group(function (){
    //签到
    Route::get('sign',[\App\Http\Controllers\api\SignController::class,'sign']);
    //签到页面数据
    Route::get('checkPage',[\App\Http\Controllers\api\SignController::class,'checkPage']);
    //活动签到
    Route::get('signActivity',[\App\Http\Controllers\api\SignController::class,'signActivity']);
});

//积分模块 wsl
Route::prefix('integral')->group(function (){
    //用户剩余积分
    Route::post('userRemainderIntegral',[\App\Http\Controllers\api\IntegralController::class,'userRemainderIntegral']);
    //积分兑换商品所需积分获取
    Route::get('exchangeGoods',[\App\Http\Controllers\api\IntegralController::class,'exchangeGoods']);
    //积分兑换优惠券所需积分获取
    Route::get('exchangeCoupon',[\App\Http\Controllers\api\IntegralController::class,'exchangeCoupon']);
    //积分兑换商品
    Route::post('integralExchangeGoods',[\App\Http\Controllers\api\IntegralController::class,'integralExchangeGoods']);
});

//抽奖模块 wsl
Route::prefix('lottery')->group(function () {
    //查询抽奖商品
    Route::get('lotteryGoods',[\App\Http\Controllers\api\LotteryController::class,'LotteryGoods']);
    //前台抽奖接口
    Route::post('lottery',[\App\Http\Controllers\api\LotteryController::class,'Lottery']);
});

// szk
Route::prefix('discount')->group(function () {
    // 前台优惠券使用改变
    Route::post('/use/discount',[\App\Http\Controllers\api\DiscountCouponController::class,'checkStatus']);
    // 查询个人的优惠券
    Route::get('/user/list/{id}', [\App\Http\Controllers\web\DiscountCouponController::class, 'userList']);
    // 根据商品查询优惠券
    Route::get('/product/discount/{id}',[\App\Http\Controllers\api\DiscountCouponController::class,'productDiscount']);
    // 用户领取优惠券
    Route::post('/user/add', [\App\Http\Controllers\web\DiscountCouponController::class, 'useradd']);
});

//wf
Route::prefix('head')->group(function (){
    //申请团长
    Route::post('applyHead',[\App\Http\Controllers\Api\HeadController::class,'applyHead']);
    //团长列表
    Route::get('headList',[\App\Http\Controllers\Api\HeadController::class,'headList']);
    //团长状态列表
    Route::get('headStatus',[\App\Http\Controllers\Api\HeadController::class,'headStatus']);
    //通过/不通过
    Route::get('adopt',[\App\Http\Controllers\Api\HeadController::class,'adopt']);
    //团长拼团商品推荐
    Route::get('recommendGoods',[\App\Http\Controllers\api\CombinationController::class,'recommendGoods']);

});

Route::prefix('remark')->group(function (){
    //添加评论
    Route::post('shopRemarkAdd',[\App\Http\Controllers\api\ShopController::class,'shopRemarkAdd']);
    //删除评论
    Route::post('shopRemarkDel',[\App\Http\Controllers\api\ShopController::class,'shopRemarkDel']);
    //查询评论
    Route::post('shopRemarkSearch',[\App\Http\Controllers\api\ShopController::class,'shopRemarkSearch']);
    //七牛云上传
    Route::post('remarkImageUpload',[\App\Http\Controllers\api\ShopController::class,'remarkImageUpload']);
});
//ylb
Route::prefix('/')->group(function (){
    //生成二维码
    Route::get("index/{uid}",[\App\Http\Controllers\web\ProductBoundController::class,'index']);

    Route::get("order/{id}",[\App\Http\Controllers\web\ProductBoundController::class,'order']);
    //取货
    Route::get("receiving_goods/{id}",[\App\Http\Controllers\web\ProductBoundController::class,'receivingGoods']);

});
Route::get("index",[\App\Http\Controllers\web\ProductBoundController::class,'index']);

Route::get("order/{id}",[\App\Http\Controllers\web\ProductBoundController::class,'order']);


Route::get("receiving_goods/{id}",[\App\Http\Controllers\web\ProductBoundController::class,'receivingGoods']);

route::get('AddMoreSpec', [\App\Http\Controllers\web\ProductController::class, 'AddMoreSpec']);
//商品添加 未完成
route::get('ProductAdd', [\App\Http\Controllers\web\ProductController::class, 'ProductAdd']);
//拼团商品添加
route::post('GroupProductAddition', [\App\Http\Controllers\web\GroupController::class, 'GroupProductAddition']);
//商品排行榜
Route::get('rankList', [ProductController::class, 'rankList']);
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});
//规格展示
route::get('AttrRuleList',[\App\Http\Controllers\web\ProductController::class,'AttrRuleList']);
//规格添加
route::get('AddMoreSpec',[\App\Http\Controllers\web\ProductController::class,'AddMoreSpec']);


//拼团
route::post('JoinGroup',[\App\Http\Controllers\api\GroupController::class,'JoinGroup']);
//用户发起拼团
route::post('UserInitGroup',[\App\Http\Controllers\api\GroupController::class,'UserInitGroup']);


Route::prefix('user')->group(function (){
    //发送验证码
    Route::get('code',[\App\Http\Controllers\api\UserLoginController::class,'sendCode']);
    //用户注册
    Route::post('register',[\App\Http\Controllers\api\UserLoginController::class,'register']);
    //校验用户登录
    Route::post('verify',[\App\Http\Controllers\api\UserLoginController::class,'verify']);
    //用户修改信息
    Route::post('upUserInfo',[\App\Http\Controllers\api\UserLoginController::class,'upUserInfo']);
});

//个人中心
Route::group(['prefix'=>'personal'],function (){
    //个人中心页面
    Route::get('index',[\App\Http\Controllers\web\PersonalController::class,'index']);
    //社区活动页面
    Route::get('article',[\App\Http\Controllers\web\PersonalController::class,'articleIndex']);
    //订单列表
    Route::get('order',[\App\Http\Controllers\web\PersonalController::class,'orderUser']);
    //团长新增
    Route::post('colonel',[\App\Http\Controllers\web\PersonalController::class,'colonelCreate']);


});

//用户退出拼团
route::post('UserExitGroup',[\App\Http\Controllers\api\GroupController::class,'UserExitGroup']);
//团长取消拼团
route::post('HeadExitGroup',[\App\Http\Controllers\api\GroupController::class,'HeadExitGroup']);
//规格删除
route::get('RuleDel',[ProductController::class,'AttrDel']);
//拼团列表（团长团的列表）
route::get('HeadGroupList',[\App\Http\Controllers\api\GroupController::class,'HeadGroupList']);

//支付
Route::prefix('pay')->group(function (){
    //支付
    Route::any('pay',[\App\Http\Controllers\api\PaymentApiController::class,'pay']);
    //支付宝回调
    Route::get('aliPaySuccess',[\App\Http\Controllers\api\PaymentApiController::class,'aliPaySuccess']);
    //提现
    Route::post('extract',[\App\Http\Controllers\api\PaymentApiController::class,'extract']);
});

//地址选择
Route::prefix('address')->group(function (){
    Route::post('address',[\App\Http\Controllers\api\addressController::class,'address']);
});

Route::prefix('member')->group(function (){
//    会员页面展示
    Route::get('memberUser',[\App\Http\Controllers\api\MemberController::class,'memberUser']);
//    会员充值
    Route::get('memberTop',[\App\Http\Controllers\api\MemberController::class,'memberTop']);
//    获取卡密
    Route::get('getSiberian',[\App\Http\Controllers\api\MemberController::class,'getSiberian']);
//    卡密认证
    Route::get('accreditedSiberian',[\App\Http\Controllers\api\MemberController::class,'accreditedSiberian']);
});
